From 4327b1944f6d14c7a2b4219f7c7aab472b11ae1a Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Fri, 11 May 2007 13:07:04 -0600 Subject: [PATCH] [IA64] Return ENOMEM if VPD allocation failed Usually ASSRET() is "(void)0". Therefore if VPD allocation fails with xenheap shortage or fragmentation, NULL pointer access occurs in vmx_final_setup_guest(). This patch fixes it. Signed-off-by: Masaki Kanno --- xen/arch/ia64/vmx/vmx_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/ia64/vmx/vmx_init.c b/xen/arch/ia64/vmx/vmx_init.c index 01c0e4a8a4..3d463191e6 100644 --- a/xen/arch/ia64/vmx/vmx_init.c +++ b/xen/arch/ia64/vmx/vmx_init.c @@ -299,6 +299,8 @@ vmx_final_setup_guest(struct vcpu *v) vpd = alloc_vpd(); ASSERT(vpd); + if (!vpd) + return -ENOMEM; v->arch.privregs = (mapped_regs_t *)vpd; vcpu_share_privregs_with_guest(v); -- 2.30.2